﻿using System;
using Newtonsoft.Json;

namespace AutoR.Helpers
{
	// Token: 0x02000241 RID: 577
	public class IntConverter : JsonConverter
	{
		// Token: 0x06000D70 RID: 3440 RVA: 0x00073A82 File Offset: 0x00071C82
		public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
		{
			writer.WriteValue((int)value);
		}

		// Token: 0x06000D71 RID: 3441 RVA: 0x00073A90 File Offset: 0x00071C90
		public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
		{
			try
			{
				return Convert.ToInt32(reader.Value);
			}
			catch (Exception)
			{
			}
			return 0;
		}

		// Token: 0x06000D72 RID: 3442 RVA: 0x00073ACC File Offset: 0x00071CCC
		public override bool CanConvert(Type objectType)
		{
			return objectType == typeof(bool);
		}
	}
}
